<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <!-- 
            key 是唯一的,不重复的值,索引不能使用,key值一般情况下会使用id,如果没有id,则需要自己设计一个属性作为唯一的值当前key值
         -->
         <!-- 静态列表 -->
         <!-- 
            <ul>
                <li v-for="(item,index) in arr" :key="item">{{item}}</li>
            </ul>    
          -->
          <!-- 动态列表 -->
          <span v-for="(item,index) in brr" :key="item">
            <input type="radio">{{item}}
          </span>
          <button @click="add">添加</button>
    </div>
</body>
<script>
    new Vue({
        el:"#app",
        data:{
            //arr:["狗蛋","翠花","铁柱"]
            brr:[1,2,3]
        },
        methods:{
            add(){
                var len = this.brr.length+1;
                this.brr.unshift(len)
            }
        }
    })
</script>
</html>